#include<iostream>
using namespace std;
int main() {
   int i=10;
   const int ci=20; //ok
   //i=20; //error: assignment of read-only variable ‘i’
   int *pi=&i; //ok
   //int *pci=&ci; //error: invalid conversion from ‘const int*’ to ‘int*’k
   const int * pci=&ci; //ok
   int const * pci2=&ci; //ok
   const int * const cpi=&i; //ok
   const int * const cpci=&ci; //ok
   //cpci=&i; //error: assignment of read-only variable ‘cpci’

   const int ci2=i; //ok
   int i2=ci2; //ok
   const int * pci3=&i; //ok
   cout<<*pci3<<endl;
   i++;
   cout<<*pci3<<endl; //ok, wow

   //i=const_cast<int>(ci); //error: invalid use of const_cast with type ‘int’, which is not a pointer, reference, nor a pointer-to-data-member type
   //pi=pci; //error: invalid conversion from ‘const int*’ to ‘int*’
   pi=const_cast<int*>(pci);

   return 0;
}
